package o;

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import javax.annotation.concurrent.GuardedBy;

public final class apl {
    private static Object ˊ = new Object();
    private static int ˋ;
    @GuardedBy("sLock")
    private static boolean ˎ;
    private static String ॱ;

    public static int ˊ(Context context) {
        ॱ(context);
        return ˋ;
    }

    private static void ॱ(Context context) {
        synchronized (ˊ) {
            if (ˎ) {
                return;
            }
            ˎ = true;
            try {
                Bundle bundle = apr.ˊ(context).ॱ(context.getPackageName(), DnsConfig.MAX_CACHE_ENTRIES).metaData;
                if (bundle == null) {
                    return;
                }
                ॱ = bundle.getString("com.google.app.id");
                ˋ = bundle.getInt("com.google.android.gms.version");
            } catch (Throwable e) {
                Log.wtf("MetadataValueReader", "This should never happen.", e);
            }
        }
    }
}
